﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="BuildMeA.cs" company="DST Nexdox">
//   Copyright (c) DST Nexdox. All rights reserved.
// </copyright>
// <summary>
//   
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace BuildMeA
{
  using System;

  using Entities;

  public class BuildMeA
  {
    public static ApplicationUserBuilder ApplicationUser(String userName)
    {
      return (ApplicationUserBuilder)new ApplicationUserBuilder().With(
        o =>
        {
          o.UserName = userName;
        });
    }

    public static ApplicationUserBuilder ApplicationUser(String userName, String forename, String surname)
    {
      return (ApplicationUserBuilder)new ApplicationUserBuilder().With(
        o =>
        {
          o.UserName = userName;
          o.FirstName = forename;
          o.LastName = surname;
        });
    }

    public static PasswordHistoryBuilder PasswordHistory(String userId, String passwordHash)
    {
      return (PasswordHistoryBuilder)new PasswordHistoryBuilder().With(
        p =>
        {
          p.UserId = userId;
          p.PasswordHash = passwordHash;
          p.LogDate = DateTime.Now;
        });
    }

    public static GlobalSettingBuilder GlobalSetting(Int32 minPasswordLength, Int32 minNonAlphaChars, Int32 passwordExpDays, Int32 passChangeBefore, Boolean newUserPasswordReset)
    {
      return (GlobalSettingBuilder)new GlobalSettingBuilder().With(
        g =>
        {
          g.MinPasswordLength = minPasswordLength;
          g.MinNonAlphaChars = minNonAlphaChars;
          g.PasswordExpDays = passwordExpDays;
          g.PassChangeBefore = passChangeBefore;
          g.NewUserPasswordReset = newUserPasswordReset;
        });
    }

    public static JobBuilder Job(DateTime createDate, DateTime finishDate, DateTime submissionDate, String userId, String grid)
    {
      return (JobBuilder)new JobBuilder().With(
        j =>
          { 
            j.createDate = createDate;
            j.FinishDate = finishDate;
            j.SubmissionDate = submissionDate;
            j.UserID = userId;
            j.GRID = grid;
          });
    }

    public static JobStatusBuilder JobStatus(DateTime dateTime)
    {
      return (JobStatusBuilder)new JobStatusBuilder().With(
        j =>
          { j.DateTime = dateTime; });
    }

    public static JobStatusTypeBuilder JobStatusType(String jobStatusDescription)
    {
      return (JobStatusTypeBuilder)new JobStatusTypeBuilder().With(
        j =>
          { j.JobStatusDescription = jobStatusDescription; });
    }

    public static ManagementCompanyBuilder ManagementCompany(String manCoName, String manCoCode, String manCoShortName, String rufusDatabaseId)
    {
      return (ManagementCompanyBuilder)new ManagementCompanyBuilder().With(
        m =>
          {
            m.ManCoName = manCoName;
            m.ManCoCode = manCoCode;
            m.ManCoShortName = manCoShortName;
            m.RufusDatabaseID = rufusDatabaseId;
          });
    }

    public static ManCoDocBuilder ManCoDoc(Int32 manCoID, Int32 documentTypeID, String pubFileName, String version, Int32 envntID)
    {
      return (ManCoDocBuilder)new ManCoDocBuilder().With(
        m =>
          { 
            m.ManCoID = manCoID;
            m.DocumentTypeID = documentTypeID;
            m.PubFileName = pubFileName;
            m.Version = version;
            m.EnvironmentID = envntID;
          });
    }

    public static StockBuilder Stock(Int32 stockTypeId, String code, String description, Int32 weight, Int32 sizeX, Int32 sizeY, String facing, DateTime dateCreated)
    {
      return (StockBuilder)new StockBuilder().With(
        s =>
          {
            s.StockTypeID = stockTypeId;
            s.Code = code;
            s.Description = description;
            s.Weight = weight;
            s.SizeX = sizeX;
            s.SizeY = sizeY;
            s.Facing = facing;
            s.DateCreated = dateCreated;
          });
    }

    public static MediaDefinitionBuilder MediaDefinition(
      Int32 manCoDocId,
      Int32 indexDefintionId,
      Int32 mailSortingId,
      Int32 finishingId,
      String createUserId,
      String queueName,
      Boolean print,
      Boolean pdfOnly)
    {
      return (MediaDefinitionBuilder)new MediaDefinitionBuilder().With(
        md =>
          {
            md.ManCoDocID = manCoDocId;
            md.IndexDefinitionID = indexDefintionId;
            md.MailsortSettingID = mailSortingId;
            md.FinishingDefID = finishingId;
            md.createUserID = createUserId;
            md.QueueName = queueName;
            md.PDF_Only = pdfOnly;
            md.Print = print;
          });
    }

    public static MediaStockBuilder MediaStock(Int32 mediaStockId, Int32 stockId, Int32 mediaDefId, DateTime publishDate, Int32 stationNumber)
    {
      return (MediaStockBuilder)new MediaStockBuilder().With(
        ms =>
          {
            ms.MediaStockID = mediaStockId;
            ms.StockID = stockId;
            ms.MediaDefID = mediaDefId;
            ms.PublishDate = publishDate;
            ms.StationNumber = stationNumber;
          });
    }

    public static DocumentTypeBuilder DocumentType(String code, String name, String typeName, Boolean additionalSetup, Boolean agentDocument)
    {
      return (DocumentTypeBuilder)new DocumentTypeBuilder().With(
        m =>
          { 
            m.BravuraDocTypeCode = code;
            m.DocumentTypeName = name;
            m.AdditionalSetup = additionalSetup;
            m.AgentDocument = agentDocument;
          });
    }

    public static ParentCompanyBuilder ParentCompany(String parentCompanyName)
    {
      return (ParentCompanyBuilder)new ParentCompanyBuilder().With(
        p =>
          { p.ParentCompany_Name = parentCompanyName; });
    }

    public static AppEnvironmentBuilder AppEnvironment(String Name)
    {
      return (AppEnvironmentBuilder)new AppEnvironmentBuilder().With(a =>
        {
          a.Name = Name;
        });
    }

    public static GroupBuilder Group(String GroupName)
    {
      return (GroupBuilder)new GroupBuilder().With(a =>
        {
          a.GroupName = GroupName;
        });
    }

    public static GroupDataRightBuilder GroupDataright(Int32 manCoId)
    {
      return (GroupDataRightBuilder)new GroupDataRightBuilder().With(a =>
        {
          a.ManCoDocID = manCoId;
        });
    }

    public static EnvironmentTypeBuilder EnvironmentType(String environmentType, String processingServerName, String ADF_DB_Name, Int32 appEnvironmentId, String bravuraDOCSEnvironmentType, String bravuraDOCSEnvironmentChar, String environmentChar)
    {
      return (EnvironmentTypeBuilder)new EnvironmentTypeBuilder().With(a =>
        {
          a.EnvironmentType1 = environmentType;
          a.ProcessingServerName = processingServerName;
          a.ADF_DB_Name = ADF_DB_Name;
          a.AppEnvironmentID = appEnvironmentId;
          a.BravuraDOCSEnvironmentType = bravuraDOCSEnvironmentType;
          a.BravuraDOCSEnvironmentChar = bravuraDOCSEnvironmentChar;
          a.EnvironmentChar = environmentChar;
        });
    }

    public static IndexDefinitionBuilder IndexDefinition(Int32 manCoDocID, String indexDefinitionName, String exstreamSymbollicIndexName, String exstreamSymbolicDataName, Int32 mailSortSettingId)
    {
      return (IndexDefinitionBuilder)new IndexDefinitionBuilder().With(
        id =>
          {
            id.ManCoDocID = manCoDocID;
            id.IndexDefinitionName = indexDefinitionName;
            id.ExstreamSymbolicIndexName = exstreamSymbollicIndexName;
            id.ExstreamSymbolicDataName = exstreamSymbolicDataName;
            id.MailSortSettingID = mailSortSettingId;
          });
    }

    public static MailSortSettingBuilder MailSortSetting(String tntDepot, String tntMailingHouse, String tntClientCode, String tntJobReference, String nexdoxMailSortService, Boolean largeLetter, Int32 fixedWeightNoOuter)
    {
      return (MailSortSettingBuilder)new MailSortSettingBuilder().With(
        ms =>
          {
            ms.TNTDepot = tntDepot;
            ms.TNTMailingHouse = tntMailingHouse;
            ms.TNTClientCode = tntClientCode;
            ms.TNTJobReference = tntJobReference;
            ms.nexdoxMailsortService = nexdoxMailSortService;
            ms.largeletter = largeLetter;
            ms.FixedWeight_NoOuter = fixedWeightNoOuter;
          });
    }

    public static MediaDefinitionAuditBuilder MediaDefinitionAudit(Int32 mediaDefinitionId, String userId, MediaDefinitionAudit.MediaDefinitionAuditType auditType, DateTime auditDate, String details)
    {
      return (MediaDefinitionAuditBuilder)new MediaDefinitionAuditBuilder().With(
        a =>
          {
            a.MediaDefinitionId = mediaDefinitionId;
            a.UserId = userId;
            a.AuditType = auditType;
            a.AuditDate = auditDate;
            a.Details = details;
          });
    }
  }
}
